package org.app.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.app.Entity.Group;
import org.app.Entity.GroupUser;

import java.util.List;

@Mapper
public interface IGroupMapper extends BaseMapper<Group> {
    Group selectById(String group_id);
    int updateById(Group group);
    Integer createExerciseGroup(Group group);
    Integer createGuideGroup(Group group);
    Integer updateAuth(GroupUser groupUser);
    Integer updateMemberNum(Group group);
    // 显示自己创建的组群
    List<Group> listOwnGroup(String c_id);
    // 显示自己加入的群组
    List<Group> listJoinGroup(String c_id);
    Integer deleteGroup(Group group);
    List<String> getAllMemberIds(String group_id);
    Integer joinGroup(GroupUser groupUser);
    Integer deleteMember(GroupUser groupUser);
    Integer updateNickName(GroupUser groupUser);
    List<GroupUser> getAllMembers(String group_id);
    GroupUser getGroupUser(@Param("group_id") String group_id, @Param("c_id") String c_id);

    void createExerciseGroupUser(Group group);

    void createGuideGroupUser(Group group);
}
